package sourceagile.server.gitFileRepository;

import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;

import sourceagile.server.localFileRepository.ReadLocalFile;

public class GetGitFileContent {

	public static JSONObject jsonFileContent(String projectName, String filePath) {

		return jsonFileContent(ReadLocalFile.readFile(projectName, filePath));
	}

	public static JSONObject jsonFileContent(String fileContent) {

		JSONObject entry = new JSONObject();

		try {

			entry.put("fileContent", fileContent);

		} catch (JSONException e) {

			e.printStackTrace();
		}

		return entry;
	}

}
